package meta.api.web.data.presentation.form;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

import meta.common.util.ListUtil;

public class FolderInfo implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    @JsonProperty(value = "_id")
    private String id;

    @JsonProperty
    private String userid;

    @JsonProperty
    private String type;

    @JsonProperty
    private String name;

    @JsonProperty
    private List<String> list;

    public String buildJsonResult() {
        StringBuffer sb = new StringBuffer();
        sb.append("{");
        sb.append("\"_id\":\"").append(id).append("\",");
        sb.append("\"userid\":\"").append(userid).append("\",");
        sb.append("\"type\":\"").append(type).append("\",");
        sb.append("\"name\":\"").append(name).append("\",");
        if (ListUtil.isEmptyList(this.list)) {
            sb.append("\"list\":[]");
        } else {
            sb.append("\"list\":").append(this.list.toString());
        }
        sb.append("}");
        return sb.toString();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }
}
